<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div style="cursor: pointer;">
            <ul v-for="(item,index) in list" :key="item.id">
                <li @click="fn(item.id)">{{item.name}} -{{index +1}}</li>
            </ul>
            <button @click="add">生成按钮</button>
        </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                list: [{
                    id: 1,
                    name: '删除'
                }]
            },
            methods: {
                add() {
                    this.list.push({
                        id: Date.now(),
                        name: '删除'
                    })
                },
                fn(id) {
                    console.log(id);
                    this.list = this.list.filter(item => item.id !== id)
                }

            }
        });
    </script>
</body>

</html>